package com.rainyun.rc.orm;

import java.util.ArrayList;
import java.util.List;

public class SqlPart {
	
	StringBuffer sql;
	List<Object> args;
	
	public SqlPart(String sql,List<Object> args) {
		this.sql = new StringBuffer(sql);
		this.args = args;
	}
	public SqlPart(String sql,Object... args) {
		this.sql = new StringBuffer(sql);
		this.args = new ArrayList<Object>();
		for(Object a:args) this.args.add(a);
	}
	
	public void append(String sql,Object... args) {
		this.sql.append(sql);
		for(Object o:args)this.args.add(o);
	}
	
	public StringBuffer getSql() {
		return sql;
	}
	public void setSql(StringBuffer sql) {
		this.sql = sql;
	}
	public Object[] getArgsArr() {
		return args.toArray();
	}
	public List<Object> getArgs() {
		return args;
	}
	public void setArgs(List<Object> args) {
		this.args = args;
	}
}
